/**
 * Created by jxy on 2016/12/5.
 * 单击确认按钮提交表单指令
 */
var app = angular.module("app");
app.directive('ngEnter', function () {
    return function (scope, element, attrs) {
        element.bind("keydown keypress", function (event) {
            if (event.which === 13) {
                scope.$apply(function () {
                    scope.$eval(attrs.ngEnter);
                });
                event.preventDefault();
            }
        });
    };
});